<?php session_start();
$db_server = "localhost";
$db_name = "erep_stats";
$db_user = "erep_stats";
$db_passwd = "_y376857EEN;";

//對資料庫連線
if(!@mysql_connect($db_server, $db_user, $db_passwd))
        die(trigger_error(mysql_error(),E_USER_ERROR));

//資料庫連線採UTF8
mysql_query("SET NAMES utf8");

//選擇資料庫
if(!@mysql_select_db($db_name))
        die("無法使用資料庫");
?>  
<?php
//連接資料庫
//只要此頁面上有用到連接MySQL就要include它

$Name = $_GET['Name'];
$ID = $_GET['ID'];
$Strength = $_GET['Strength'];
$MilitaryRank = $_GET['MilitaryRank'];
$MilitaryEXP = $_GET['MilitaryEXP'];
$avatar = $_GET['avatar'];

$sql = "SELECT * FROM members WHERE id = '$ID'";
$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);
$member_id = $row['member_id'];
echo $member_id;

if($member_id != NULL) {
$Result1 = mysql_query("UPDATE members SET name='$Name', avatar='$avatar', Strength='$Strength', MilitaryRank='$MilitaryRank', MilitaryEXP='$MilitaryEXP',id='$ID' WHERE member_id= '$member_id'") or die(mysql_error());

echo "done";
}
else {
	echo "error";
}
?>

